module filling::filling;

use std::string::String;
use sui::event;

public struct Profile has key {
    id: UID,
    name: String,
    description: String,
}

// event struct
public struct ProfileCreated has copy, drop {
    id: ID,
    owner: address,
}

// Entry Functions
public entry fun create_profile(name: String, description: String, ctx: &mut TxContext) {
    let owner: address = tx_context::sender(ctx);
    let uid = object::new(ctx);
    let id: ID = object::uid_to_inner(&uid);
    let new_profile = Profile {
        id: uid,
        name,
        description,
    };
    transfer::transfer(new_profile, owner);
    event::emit(ProfileCreated { id, owner })
}
